<?php

require_once 'common/conn.php';
$db = new DBC();
$type = $_GET['type'];
if (!isset($type)) {
    $type = $_POST['type'];
}
if (isset($_GET['start'])) {
    $start = $_GET['start'];
} else {
    $start = 0;
}
if (isset($_GET['limit'])) {
    $count = $_GET['limit'];
}
if ($type == "property") {
    $sql = "SELECT * FROM t_hibaby_propertyset ORDER BY top LIMIT " . $start . "," . $count;
} else if ($type == "avatar") {
    $sql = "SELECT * FROM t_hibaby_avatar LIMIT " . $start . "," . $count;
} else if ($type == "gold") {
    $sql = "SELECT * FROM t_hibaby_gold LIMIT " . $start . "," . $count;
}

echo json_encode($db->fetchData($sql));
?>
